# File Name:  CR_Figure1.R
# Data:       None
# Purpose:    Create a plot that shows equlibrium outcomes for lawmaking models.


#create ideal points for each player;
m<-51
v<-34
f<-60
p<-63
g<-23

#reflections for pivot model
rf<-2*f-m
rv<-2*v-m

#reflections for negative agenda control
rp<-2*p-m
rpa<-2*m-p

#reflections for executive agenda control
rg<-2*m-g

#Create the blank plot
pdf(file="C:/Users/mdr/Dropbox/Vanderbilt/Fall 2013/Project/Charter/ClintonRichardson Draft/Figures/eqm_plot.pdf",height=7,width=10)
par(cex.axis=1,mar=c(5,5,2,2),cex=1.3)
plot(NA,NA,xlim=c(0,100),ylim=c(0,110),xlab="Status Quo Policy", ylab="Policy Outcome\n ",xaxt="n",yaxt="n")
axis(side=1,at=c(rf,f,m,v,g,rv,p,rp,rpa,rg),labels=c("2f-m","f","m","v","g","2v-m","p","2p-m","2m-p","2m-g"),cex.axis=.8,las=2)
axis(side=2,at=c(rf,f,m,v,g,rv,p,rp,rpa,rg),labels=c("2f-m","f","m","v","g","2v-m","p","2p-m","2m-p","2m-g"),cex.axis=.8,las=1)

#Pivotal politics
segments(-5,m,rv,m,lwd=3)
segments(rv,m,v,v,lwd=3)
segments(v,v,f,f,lwd=3)
segments(f,f,rf,m,lwd=3)
segments(rf,m,100,m,lwd=3)

#Negative agenda control
segments(-5,m,m,m,lty=3,lwd=4)
segments(m,m,rp,rp,lty=3,lwd=4)
segments(rp,m,100,m,lty=3,lwd=4)

#Positive agenda control
segments(-5,p,rpa,p,lty=4,lwd=3)
segments(rpa,p,m,m,lty=4,lwd=3)
segments(m,m,p,p,lty=4,lwd=3)
segments(p,p,100,p,lty=4,lwd=3)

#Executive agenda control
segments(-5,g,g,g,lty=2,lwd=3)
segments(g,g,m,m,lty=2,lwd=3)
segments(m,m,rg,g,lty=2,lwd=3)
segments(rg,g,100,g,lty=2,lwd=3)

legend("topright",legend=c("Pivot Model","Negative Agenda Power","Positive Agenda Power", "Executive Agenda Power"),
       lty=c(1,3,4,2),lwd=c(3,4,3,3))

dev.off()


